from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
import time
def she():
    q = Options()
    q.add_argument('--no-sandbox')
    # q.add_experimental_option('detach', True)
    d = webdriver.Chrome(service=Service('chromedriver.exe'), options=q)
    return d

def open_url(url):
    d.get(url)
    # d.maximize_window()

def set_window_size():
    # 设置浏览器打开位置
    d.set_window_position(500,500)
    # 设置浏览器尺寸
    d.set_window_size(900,900)
    time.sleep(200)

if __name__ == '__main__':
    d = she()
    open_url('https://www.baidu.com')
    set_window_size()
